package a.stategy;

/**
 * 返利收费子类
 */
public class CashReturn extends CashSuper{

    public CashReturn(double monryCondition, double moneyValue) {
        this.moneyCondition = monryCondition;
        this.moneyValue = moneyValue;
    }

    //返利条件
    private double moneyCondition;
    //返利值
    private double moneyValue;


    @Override
    Double acceptCash(Double money) {
        if (money>=moneyCondition){
            return (money-moneyValue);
        }else {
            return money;
        }
    }
}
